package controller
{
	import flash.text.TextField;
	
	import model.vo.PageVO;
	
	import subumbo.micro.controller.ApplicationEvent;
	import subumbo.micro.controller.Component;
	import subumbo.micro.model.Model;
	
	public class PageViewController extends Component
	{
		public var titleTxt:TextField;
		public var descriptionTxt:TextField;
		
		override protected function bind(e:ApplicationEvent):void
		{
			var vo:PageVO = PageVO(Model.instance.pages[0]);
			titleTxt.text = vo.name;
			descriptionTxt.text = vo.description;
			super.bind(e);
		}
		
		override public function update(e:ApplicationEvent):void
		{
			if(e.data is PageVO)
			{
				var vo:PageVO = PageVO(e.data);
				titleTxt.text = vo.name;
				descriptionTxt.text = vo.description;
			}
		}
	}
}